-
Notifications
You must be signed in to change notification settings - Fork 254
Lock Exchange Example #4968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Lock Exchange Example #4968
Conversation
| # Allow for mutable surface height | ||
| z_disc = MutableVerticalDiscretization((-50, 0)) | ||
|
|
||
| # Initialize the grid | ||
| underlying_grid = RectilinearGrid( | ||
| size = (Nx, Nz), | ||
| x = (0, L), | ||
| z = z_disc, | ||
| topology = (Bounded, Flat, Bounded), | ||
| halo = (5, 5) | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # Allow for mutable surface height | |
| z_disc = MutableVerticalDiscretization((-50, 0)) | |
| # Initialize the grid | |
| underlying_grid = RectilinearGrid( | |
| size = (Nx, Nz), | |
| x = (0, L), | |
| z = z_disc, | |
| topology = (Bounded, Flat, Bounded), | |
| halo = (5, 5) | |
| ) | |
| # Allow for mutable surface height | |
| z = MutableVerticalDiscretization((-50, 0)) | |
| x = (0, L) | |
| # Initialize the grid | |
| underlying_grid = RectilinearGrid(size = (Nx, Nz); halo = (5, 5), x, z, topology = (Bounded, Flat, Bounded)) |
| @@ -0,0 +1,63 @@ | |||
| using Oceananigans | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a description of what this example hopes to achieve, similar to the other examples?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added some more descriptive documentation here and I plan to add some more as well.
| using Oceananigans.Units | ||
| using Oceananigans.Grids: MutableVerticalDiscretization | ||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason, I am getting an error when I remove these lines and don't import some methods explicitly. May I ask if you have seen that before?
examples/lock_exchange.jl
Outdated
| simulation = Simulation(model; Δt, stop_time) | ||
|
|
||
| # Run simulation | ||
| run!(simulation) No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example should conclude with a visualization of the results, including some analysis / physical interpretation of what the results show
examples/lock_exchange.jl
Outdated
| buoyancy = BuoyancyTracer(), | ||
| momentum_advection = WENO(order=5), | ||
| tracer_advection = WENO(order=7), | ||
| closure = (VerticalScalarDiffusivity(ν=1e-4), HorizontalScalarDiffusivity(ν=1.0)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| closure = (VerticalScalarDiffusivity(ν=1e-4), HorizontalScalarDiffusivity(ν=1.0)), |
I suggest running this as an ILES unless that doesn't work for some reason!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I have removed the closure.
examples/lock_exchange.jl
Outdated
| # Runge Kutta good for integrating multiple processes | ||
|
|
||
| model = HydrostaticFreeSurfaceModel(; grid, | ||
| tracers = (:b,), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| tracers = (:b,), | |
| tracers = :b, |
| simulation = Simulation(model; Δt, stop_time) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a progress function and output, similar to other examples?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added a progress function and output visualization which I have attached in another comment below.
|
@glwagner Thank you very much for your helpful feedback. I've been working on adding some more documentation as well as visualization for the outputs of the simulation. I have attached the animation that is produced here. I plan to continue to add some helpful documentation to explain some of the numerical methods or physics behind the remaining code that is not as commented, and I will commit that as soon as I can. Of the code that is now added, I pulled strongly from some of the existing examples, but please let me know if there is anything else that you would like to see or to change. Looking at this result of the simulation, can I ask if the parameters make sense for this use case or if there is too much noise? Also, I only ran simulation for 1 day initially to make sure that I am getting an output, but would you recommend a different runtime? lock_exchange.mp4 |
Hello Oceananigans community, I am fairly new here and I am interested in building my simulations and contribution skills with the Oceananigans package. I have opened a discussion post here and an issue here, with idea of implementing a basic lock-exchange problem. My goal is to use this case to deepen my understanding of computational fluid dynamics, boundary conditions, and density-driven mixing. My ideal outcome is to produce a fully documented example script that meets the standards of the existing examples.
I have opened this PR with a very basic version which includes my current understanding of how to run the simulations. I will happily welcome any and all feedback for any changes or ideas that would help me build on this existing script to make it a worthwhile contribution. So far, I have pulled from the internal tide example as well as the lock release validation case, and I will continue to build on what I have so far.
Thank you in advance for your time and help!